package es.ats.codington.festival.Mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import es.ats.codington.festival.domain.Event;
import es.ats.codington.festival.domain.Place;

public class EventMapper implements RowMapper<Event>{
	
	@Override
	public Event mapRow(ResultSet resultSet, int numRow) throws SQLException {
		Event event = new Event();
		Place place = new Place();
		
		event.setNamevent(resultSet.getString("name"));
		event.setPrice(resultSet.getFloat("price"));
		event.setDescription(resultSet.getString("descriptions"));
		event.setSeats(resultSet.getInt("seats"));
		event.setiDevent(resultSet.getInt("idevent"));
		place.setiDplace(resultSet.getInt("idplace"));
		event.setPlace(place);
			
			
		return event;
	}


}
